-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selecting train IDs in DataCollection and SourceData #559
base: master
Are you sure you want to change the base?
Conversation
I have a minor comment (see review), otherwise everything LGTM! The RTD should also be updated, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo the minor comment, LGTM!
|
||
raise TypeError("Expected data[source] or data[source, key]") | ||
raise TypeError("Expected data[source], data[source, key] or data[train_selection]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While trying to trigger this error, I ran across a surprising (to me) behavior, the following does not raise this error:
run['SA3_XTD10_XGM/XGM/DOOCS:output', 2]
rather, it returns a very sensible object:
<extra_data.SourceData source='SA3_XTD10_XGM/XGM/DOOCS:output' for 1 trains>
I suppose this is part of train_selection
but I couldn't easily find it documented anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, interesting side effect. but yes, since this essentially does run[source][key]
and now that SourceData[key]
can be used for filtering trains, it makes sense.
I'm fine keeping that behavior, unless others object.
assert sel.train_ids == list(range(10000, 10010)) | ||
|
||
sel = xgm[10] | ||
assert sel.train_ids == [10010] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I see that this is the same behavior I flagged above ✔️ so it's only a matter of documentation if it's indeed missing (I could have simply missed it)
…-data into feat/trainid-slicing
I added a few lines in the docs, will merge in a few days (when Thomas is back) if no-one objects the hybrid behavior. |
Allow using the
object[]
syntax to select train IDs in addition to source or keys forDataCollection
andSourceData